<%@ page import="java.util.ArrayList" %>
<%@ page import="com.jr.pojo.ProjectInfo" %><%--
  Created by IntelliJ IDEA.
  User: a
  Date: 2025/8/26
  Time: 14:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>$Title$</title>
</head>
<body>

<form action="/asd/projectInfo/query" method="get">
    申报状态<select name="status">
    <option value="-1">全部</option>
    <option value="0">已申报</option>
    <option value="1">审核中</option>
    <option value="2">已审核</option>
</select>
    <input type="submit" value="查询">
</form>

<%
    ArrayList<ProjectInfo> list = (ArrayList<ProjectInfo>) session.getAttribute("list");
%>
<table>
    <caption>申报项目列表</caption>
    <tr>
        <th>项目编号</th>
        <th>项目名称</th>
        <th>开始时间</th>
        <th>结束时间</th>
        <th>申报状态</th>
        <th>操作</th>
    </tr>
    <% for (ProjectInfo pro : list) { %>
    <tr>
        <td><%=pro.getPid()%></td>
        <td><%=pro.getPname()%></td>
        <td><%=pro.getStartdate()%></td>
        <td><%=pro.getEnddate()%></td>
        <td><%=getProStatus(pro.getStatus())%></td>
        <td>
            <% if (pro.getStatus() == 0) {%>
                <a href="/asd/projectInfo/queryByPid?pid=<%=pro.getPid()%>">审核</a>
            <% }%>
        </td>
    </tr>
    <% } %>
    <tr>
        <td colspan="6">
            <% Object mess=session.getAttribute("mess");
                if(mess!=null){
            %>
            <b style="color:red"><%=mess%></b>
            <%
                }
            %>
        </td>
    </tr>
</table>
<%!
 public String getProStatus(int status){
     if(status==0){
       return "已申报";
     }else if(status==1){
         return "审核中";
     }else {
         return "已审核";
     }
 }
%>

</body>
</html>
